package com.eclipse.e0112_io.bz案例;

import java.io.FileReader;
import java.io.IOException;

public class Test6 {

	public static void main(String[] args) {
		
		FileReader fr = null;
		try {
			//读取文件
			fr = new FileReader("/Users/liuzhuangzhuang/Desktop/io/a.txt");

			int result = 0;
			
			char[] cbuf=new char[10];
			
			//如果不等于-1 
			while (result != -1) {
				result = fr.read();
				//result=fr.read(cbuf);
				System.out.println((char) result);
			}

		} catch (Exception ex) {
			ex.printStackTrace();
		} finally {
			if (null != fr) {
				try {
					fr.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

}
